package com.cloud.rou.im.connection.container.connection;

import com.cloud.rou.im.connection.instance.ImServerInstanceFactory;
import io.netty.channel.ChannelHandlerContext;
import io.netty.util.AttributeKey;
import lombok.Data;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 */
@Data
public class Connection {


    private ChannelHandlerContext ctx;

    public Connection(Long userId,ChannelHandlerContext ctx){
        this.ctx=ctx;
        ctx.channel().attr(UserIdAttributeKey.USER_ID).set(userId);
        ctx.channel().attr(UserIdAttributeKey.CONNECTOR_ID).set(ImServerInstanceFactory.getConnectorId());
    }

}
